package com.wanmao.test.framgent;

import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.wanmao.test.R;
import com.wanmao.test.SettingActivity;
import com.wanmao.test.util.PerferenceUntil;
import com.wanmao.test.util.StaticUtil;

import nari.mip.core.Platform;


public class Page04 extends Fragment implements View.OnClickListener {
	private LinearLayout layout_setting;
	private Button btn_back;
	private TextView tv_name,tv_bumen,tv_zhuanye;
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
							 Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.page04,container, false);
		intenView(view);
		return view;
	}


	private void intenView(View view) {
		tv_name=(TextView) view.findViewById(R.id.tv_person_name);
		tv_bumen=(TextView) view.findViewById(R.id.tv_person_bumen);
		tv_zhuanye=(TextView) view.findViewById(R.id.tv_person_zhuanye);
		tv_name.setText(StaticUtil.RYMC);
		tv_bumen.setText(StaticUtil.DEPTNAME);
		tv_zhuanye.setText(StaticUtil.RYZY);
		btn_back=(Button) view.findViewById(R.id.btn_person_back);
		btn_back.setOnClickListener(this);
		layout_setting=(LinearLayout) view.findViewById(R.id.layout_setting);
		layout_setting.setOnClickListener(this);
	}

	@Override
	public void onClick(View view) {
		switch (view.getId()){
			case R.id.layout_setting :
				Intent intent=new Intent();
				intent.setClass(getActivity(), SettingActivity.class);
				startActivity(intent);
				break;
			case R.id.btn_person_back :
				PerferenceUntil.shareLogin(getActivity(),false);
				Platform.getCurrent().logout(getActivity().getApplicationContext());
				break;
		}
	}
}
